﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Microsoft.Practices.ServiceLocation;

namespace NHibernate.Audit.Contract
{
    public abstract class AbstractContract<T> : AbstractFixture  
    {

        protected override void OnFixtureSetUp()
        {
            ServiceLocator = SetupServiceLocator();
            base.OnFixtureSetUp();
        }

        protected abstract IServiceLocator SetupServiceLocator();
        
        protected IServiceLocator ServiceLocator { get; private set; }

        [Test]
        public void can_get_implementation()
        {
            T implementation = ServiceLocator.GetInstance<T>();
            Assert.IsNotNull(implementation);
        }

    }
}
